import {
  Component, OnInit, Input, ViewChild, ElementRef, ChangeDetectionStrategy, AfterContentInit,
  ViewEncapsulation
} from '@angular/core';
import {ToolsService} from "../../../service/tools/tools.service";


@Component({
  selector: 'seed-swiper-slide',
  templateUrl: './swiper-slide.component.html',
  styleUrls: ['./swiper-slide.component.scss'],
  encapsulation: ViewEncapsulation.None,
  host: {
    '(window:resize)': 'onResize()'
  }
})
export class SwiperSlideComponent implements OnInit {
  constructor(private ele: ElementRef,
              private tools: ToolsService) {
  }

  onResize() {
    this.ele.nativeElement.style.width = this.tools.getWindowSize().width + 'px';
  }

  ngOnInit() {
    this.onResize();
  }
}
